package StructuralMode.combination.safeMode;

import java.util.LinkedList;

public class NodeBranch extends NodeComponent{

    private LinkedList<NodeComponent> nodeList = new LinkedList();

    public NodeBranch(String name, Integer level) {
        super(name, level);
    }

    @Override
    public NodeComponent add(NodeComponent nodeComponent) {
        nodeList.add(nodeComponent);
        return this;
    }

    @Override
    public void del(NodeComponent nodeComponent) {
        nodeList.remove(nodeComponent);
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public void print(){
       super.print();
       nodeList.forEach(node -> {
           node.print();
       });
    }

}
